<cfcomponent displayname="application" output="false">
	<cfset this.Name="NoWriSts">
	<cfset this.ApplicationTimeout=CreateTimeSpan(0,24,0,0)>
	<cfset this.ClientManagement=false>
	<cfset this.SetDomainCookies=false>
	<cfset this.SetClientCookies=true>
	<cfset this.ScriptProtect=true>
	<cfset this.SessionManagement=true>
	<cfset this.SessionTimeout=CreateTimeSpan(0,4,0,0)>
	
	<cffunction name="onApplicationStart" returntype="boolean" output="false">
		<!--- <cfset Application.Util=CreateObject("component","org.rickosborne.util").init()> --->
		<cfreturn true>
	</cffunction>
	
	<cffunction name="onApplicationEnd" returntype="void" output="false">
		<cfargument name="ApplicationScope" required="true">
	</cffunction>
	
	<cffunction name="onRequestStart" returntype="boolean" output="false">
		<cfargument name="ThePage" type="string" required="true">
		<cfif StructKeyExists(URL,"ForceAppInit")>
			<cfset this.onApplicationStart()>
		</cfif>
		<!--- Keep people from looking at our include-only templates --->
		<cfif CGI.SERVER_PORT eq 443>
			<cfset Request.Proto="https">
		<cfelse>
			<cfset Request.Proto="http">
		</cfif>
		<cfset Request.Host=CGI.HTTP_HOST>
		<cfset Request.Path=CGI.SCRIPT_NAME>
		<cfset Request.PathNoIndex=Request.Path>
		<cfset Request.PathInfo=CGI.PATH_INFO>
		<cfset Request.File=ListLast(Request.Path,"/")>
		<cfset Request.Query=CGI.QUERY_STRING>
		<cfset Request.GoogleKey="ABQIAAAAYfesWsXNyDeYsDVGBHD7IhQClrfbmT0upd-g8dHy6n61er1tFBQDofhvuO0QHndFxFKSSLq1_eV9vg">
		<cfset Request.GoogleKey="ABQIAAAAYfesWsXNyDeYsDVGBHD7IhSytb5UlMIrbrmY6d9pBFZ4rrsQ0BSoIDwy5TpSrbUbZR3UseBcBD1rEg">
		<cfif not structKeyExists(Session, "GeoKey")>
			<cfset Session.GeoKey=CreateUUID()>
		</cfif>
		<cfif Left(Request.PathInfo, Len(Request.Path)) eq Request.Path>
			<cfif Len(Request.PathInfo) gt Len(Request.Path)>
				<cfset Request.PathInfo=Mid(Request.PathInfo, Len(Request.Path) + 1, Len(Request.PathInfo))>
			<cfelse>
				<cfset Request.PathInfo="">
			</cfif>
		</cfif>
		<cfif Right(Request.PathNoIndex,10) eq "/index.cfm">
			<cfset Request.PathNoIndex=Left(Request.PathNoIndex, Len(Request.PathNoIndex) - 9)>
		</cfif>
		<cfif (Left(Request.File,1) EQ "_")>
			<cfthrow message="Access Denied" detail="You do no have access to the page you have requested.">
		</cfif>
		<cfif (Right(Request.File,4) EQ ".cfc")>
			<cfsetting showdebugoutput="false">
		</cfif>
		<!--- Set up our page environment --->
		<cfset Request.Browser=CreateObject("component","org.rickosborne.util.browser").init()>
		<!--- Anti-caching mojo --->
		<cfif (Request.File NEQ "n6.cfm") AND (Request.File NEQ "worldmap.cfm")>
			<cfheader name="Pragma" value="no-cache">
			<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate, max-age=0, post-check=0, pre-check=0">
			<cfheader name="Expires" value="Tue, 25 Jan 2000 10:30:00 GMT">
			<cfheader name="Last-Modified" value="#DateFormat(Now(),'ddd, dd mmm yyyy')# #TimeFormat(Now(),'HH:MM:SS')# GMT">
		</cfif>
		<cfcontent reset="true">
		<cfreturn true>
	</cffunction>
	
	<!--- 
	<cffunction name="onRequest" returntype="void">
		<cfargument name="ThePage" type="string" required="true">
	</cffunction>
	--->
	
	<cffunction name="onRequestEnd" returntype="void" output="false">
		<cfargument name="ThePage" type="string" required="true">
	</cffunction>
	<!--- 
	<cffunction name="onError" returntype="void" output="false">
		<cfargument name="Exception" required="true">
		<cfargument name="EventName" type="string" required="true">
		<cfdump var="#Exception#">
	</cffunction>
	 --->
	<cffunction name="onSessionStart" returntype="void" output="false">
	</cffunction>
	
	<cffunction name="onSessionEnd" returntype="void" output="false">
		<cfargument name="SessionScope" type="struct" required="true">
		<cfargument name="AppScope" type="struct" required="false">
	</cffunction>
</cfcomponent>
